//
//  TopView.m
//  DZZTravel
//
//  Created by 杜东坡 on 16/7/14.
//  Copyright © 2016年 Eason. All rights reserved.
//

#import "TopView.h"
#import "DZZDisInfoController.h"

@interface  TopView()


@end

@implementation TopView

- (UIImageView *)imageView1 {
    if (!_imageView1) {
        _imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, self.frame.size.width-10, 250)];
    }
    return _imageView1;
}
- (UILabel *)titleLabel1 {
    if (!_titleLabel1) {
        _titleLabel1 = [[UILabel alloc]initWithFrame:CGRectMake(5, 255, self.frame.size.width-10, 21)];
    }
    return _titleLabel1;
}

- (UILabel *)subTitLabel1 {
    if (!_subTitLabel1) {
        _subTitLabel1 = [[UILabel alloc]initWithFrame:CGRectMake(5, 276, self.frame.size.width-10, 21)];
        
        [_subTitLabel1 setFont:[UIFont systemFontOfSize:12]];
        _subTitLabel1.numberOfLines = 0;
    }
    return _subTitLabel1;
}

- (UILabel *)locationLabel1 {
    if (!_locationLabel1) {
        _locationLabel1 = [[UILabel alloc]init];
    }
    return _locationLabel1;
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        [self addSubview:self.imageView1];
        [self addSubview:self.titleLabel1];
        [self addSubview:self.subTitLabel1];
        [self addSubview:self.locationLabel1];
        
    }
    return self;
}


- (void)setTopViewWithModel:(DiscoverModel *)model {

    [self.imageView1 sd_setImageWithURL:[NSURL URLWithString:model.imageUrl]];
    self.titleLabel1.text = model.title;
    self.subTitLabel1.text = model.des;
   
}





@end
